﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SuspendRemoveUser.aspx.cs" Inherits="AdminPages_SuspendRemoveUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h5>All unsuspended Users</h5>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="CustomerID" 
    DataSourceID="SqlDataSource1" onrowcommand="GridView1_RowCommand">
    <Columns>
        <asp:BoundField DataField="UserName" HeaderText="UserName" 
            SortExpression="UserName" />
        <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
            SortExpression="FirstName" />
        <asp:BoundField DataField="LastName" HeaderText="LastName" 
            SortExpression="LastName" />
        <asp:ButtonField ButtonType="Button" CommandName="suspend" 
            Text="Suspend User" />
        <asp:ButtonField ButtonType="Button" CommandName="remove" Text="Remove User" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
    
        SelectCommand="SELECT CustomerID, UserName, FirstName, LastName FROM Customer WHERE (Suspended = 0)">
</asp:SqlDataSource>
<h5>All suspended Users</h5>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2" onrowcommand="GridView2_RowCommand" 
        AllowPaging="True">
        <Columns>
            <asp:BoundField DataField="UserName" HeaderText="UserName" 
                SortExpression="UserName" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:ButtonField ButtonType="Button" CommandName="unsuspend" 
                Text="Unsuspend User" />
            <asp:ButtonField ButtonType="Button" CommandName="remove" Text="Remove User" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT UserName, FirstName, LastName FROM Customer WHERE (Suspended = 1)">
    </asp:SqlDataSource>
</asp:Content>

